﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using DAL;
namespace BLL
{
   public class PermissionBll
    {
       PermissionDal dal = new PermissionDal();
       /// <summary>
       /// 显示权限
       /// </summary>
       /// <returns></returns>
       public List<Permission> ShowPermission()
       {
           return dal.Show();
       }

       public List<Permission> PaperPermission(int PageIndex, int PageSize, out int PageCount)
       {
           PageCount = dal.Show().Count();
           return dal.Show().Skip((PageIndex - 1) * PageSize).Take(PageSize).ToList();
       }
       /// <summary>
       /// 添加权限
       /// </summary>
       /// <param name="m"></param>
       /// <returns></returns>
       public bool AddPermission(Permission m)
       {
           return dal.Add(m);
       }
       /// <summary>
       /// 删除权限
       /// </summary>
       /// <param name="m"></param>
       /// <returns></returns>
       public bool DelPermission(Permission m)
       {
           return dal.Del(m);
       }

       /// <summary>
       /// 查询单个权限信息
       /// </summary>
       /// <param name="id"></param>
       /// <returns></returns>
       public Permission BackPermission(int id)
       {
           return dal.Back(id);
       }

       /// <summary>
       /// 修改权限信息
       /// </summary>
       /// <param name="m"></param>
       /// <param name="id"></param>
       /// <returns></returns>
       public bool UpdPermission(Permission m, int id)
       {
           return dal.Update(m, id);
       }





    }
}
